import request from '@/utils/request'

// productLists全部显示
export function productLists(query) {
    return request({
      url: '/api/product/list',
      method: 'get',
      params: query
    })
  }

//隐藏的
export function productallLists(query) {
    return request({
      url: '/api/Ts/product/allList',
      method: 'get',
      params: query
    })
  }

// listApproval
export function listApproval(query) {
  return request({
    url: '/api/jh/product/listApproval',
    method: 'get',
    params: query
  })
}

// listRemark
export function listRemark(query) {
  return request({
    url: '/safety/remark/list',
    method: 'get',
    params: query
  })
}


// getProductDetail
export function getProductDetail(id) {
  return request({
    url: '/api/jh/product?id=' +id,
    method: 'get',
  })
}

// getProductFileList
export function getProductFileList(id) {
  return request({
    url: '/api/jh/product/getProductFileList?productId=' +id,
    method: 'get',
  })
}

// exportPlm
export function exportPlm(id) {
  return request({
    url: '/api/jh/product/exportPlm?productId=' +id,
    method: 'get',
  })
}


// mergeINCIRiskList
export function mergeINCIRiskList(id) {
  return request({
    url: '/api/jh/product/fm/mergeINCIRiskList?id=' +id,
    method: 'get',
  })
}
  
// reportLists
export function reportLists(query) {
    return request({
      url: '/api/product/report/list',
      method: 'get',
      params: query
    })
  }

// templatelist
export function template(query) {
    return request({
      url: '/api/report/template',
      method: 'get',
      params: query
    })
  } 

// templateInsert
export function templateInsert(data) {
    return request({
      url: '/api/report/template/insert',
      method: 'post',
      data: data
    })
  }

//INCI导入查看风险物质
export function importInciRiskJh(data) {
  return request({
    url: '/api/jh/product/importInciRiskJh',
    method: 'post',
    data: data
  })
}
// updateReport
export function updateReport(data) {
  return request({
    url: '/api/jh/product/updateReport',
    method: 'post',
    data: data
  })
}
  
// templateUpdate
export function templateUpdate(data) {
    return request({
      url: '/api/report/template/update',
      method: 'post',
      data: data
    })
  }
  
// 查询风险物质管理列表
export function listSubstance(query) {
    return request({
      url: '/api/risksubstance/list',
      method: 'get',
      params: query
    })
  } 

// Delete
export function Delete(data) {
    return request({
      url: '/api/report/template/delete',
      method: 'post',
      data: data
    })
  }

// delProduct
export function delProduct(data) {
  return request({
    url: '/api/product',
    method: 'delete',
    data: data
  })
}

// 软删除产品信息
export function deltsProduct(data) {
  return request({
    url: '/api/Ts/product',
    method: 'delete',
    data: data
  })
}

// 软删除恢复产品信息
export function recoverProduct(data) {
  return request({
    url: '/api/Ts/recoverProduct',
    method: 'post',
    data: data
  })
}

// addFm
export function addFm(data) {
  return request({
    url: '/api/product/fm',
    method: 'post',
    data: data
  })
}

// editFm
export function editFm(data) {
  return request({
    url: '/api/product/fm/fix',
    method: 'post',
    data: data
  })
}

// subjectTestResult
export function subjectTestResult(id) {
  return request({
    url: '/api/product/subjectTestResult?id=' +id,
    method: 'get',
  })
} 

// updateSubjectTestResult
export function updateSubjectTestResult(id,data) {
  return request({
    url: '/api/product/updateSubjectTestResult/' +id,
    method: 'put',
    data: data
  })
}

// addproduct
export function add(data) {
    return request({
      url: '/api/product',
      method: 'post',
      data: data
    })
  }

// editProduct
export function editProduct(data) {
    return request({
      url: '/api/product',
      method: 'put',
      data: data
    })
  }

// createReport
export function createReport(id) {
  return request({
    url: '/api/product/fm/createReport?id=' +id,
    method: 'get',
  })
} 




